import request from './request';
import type { PoliticsAccumulation, ApiResponse } from '@/types/accumulation';

// 获取时政积累列表
export function getPoliticsAccumulations() {
  return request({
    url: '/api/politics-accumulation/list',
    method: 'get',
  });
}

// 新增时政积累
export function addPoliticsAccumulation(data: PoliticsAccumulation) {
  return request({
    url: '/api/politics-accumulation/add',
    method: 'post',
    data
  });
}

// 更新时政积累
export function updatePoliticsAccumulation(data: PoliticsAccumulation) {
  return request({
    url: '/api/politics-accumulation/update',
    method: 'put',
    data
  });
}

// 删除时政积累
export function deletePoliticsAccumulation(id: number) {
  return request({
    url: `/api/politics-accumulation/delete/${id}`,
    method: 'delete'
  });
}

// 批量删除时政积累
export function batchDeletePoliticsAccumulations(ids: number[]) {
  return request({
    url: '/api/politics-accumulation/delete/batch',
    method: 'delete',
    data: ids
  });
}

// 根据ID获取时政积累详情
export function getPoliticsAccumulationById(id: number) {
  return request({
    url: `/api/politics-accumulation/${id}`,
    method: 'get'
  });
}